<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>cancellation_state::cancellation_state (3 of 4 overloads)</title>
    <link rel="stylesheet" href="../../../../boostbook.css" type="text/css">
    <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
    <link rel="home" href="../../../../index.html" title="Asio">
    <link rel="up" href="../cancellation_state.html" title="cancellation_state::cancellation_state">
    <link rel="prev" href="overload2.html" title="cancellation_state::cancellation_state (2 of 4 overloads)">
    <link rel="next" href="overload4.html" title="cancellation_state::cancellation_state (4 of 4 overloads)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%">
    <tr>
        <td valign="top"><img alt="asio C++ library" width="250" height="60" src="../../../../asio.png"></td>
    </tr>
</table>
<hr>
<div class="spirit-nav">
    <a accesskey="p" href="overload2.html"><img src="../../../../prev.png" alt="Prev"></a><a accesskey="u"
                                                                                             href="../cancellation_state.html"><img
        src="../../../../up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img
        src="../../../../home.png" alt="Home"></a><a accesskey="n" href="overload4.html"><img src="../../../../next.png"
                                                                                              alt="Next"></a>
</div>
<div class="section">
    <div class="titlepage">
        <div>
            <div><h5 class="title">
                <a name="asio.reference.cancellation_state.cancellation_state.overload3"></a><a class="link"
                                                                                                href="overload3.html"
                                                                                                title="cancellation_state::cancellation_state (3 of 4 overloads)">cancellation_state::cancellation_state
                (3 of 4 overloads)</a>
            </h5></div>
        </div>
    </div>
    <p>
        Construct and attach to a parent slot to create a new child slot.
    </p>
    <pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span>
    <span class="keyword">typename</span> <a class="link" href="../../CancellationSlot.html"
                                             title="Cancellation slot requirements">CancellationSlot</a><span
                class="special">,</span>
    <span class="keyword">typename</span> <span class="identifier">Filter</span><span class="special">&gt;</span>
<span class="keyword">constexpr</span> <span class="identifier">cancellation_state</span><span class="special">(</span>
    <span class="identifier">CancellationSlot</span> <span class="identifier">slot</span><span class="special">,</span>
    <span class="identifier">Filter</span> <span class="identifier">filter</span><span class="special">);</span>
</pre>
    <h6>
        <a name="asio.reference.cancellation_state.cancellation_state.overload3.h0"></a>
        <span><a name="asio.reference.cancellation_state.cancellation_state.overload3.parameters"></a></span><a
            class="link"
            href="overload3.html#asio.reference.cancellation_state.cancellation_state.overload3.parameters">Parameters</a>
    </h6>
    <div class="variablelist">
        <p class="title"><b></b></p>
        <dl>
            <dt><span class="term">slot</span></dt>
            <dd><p>
                The parent cancellation slot to which the state will be attached.
            </p></dd>
            <dt><span class="term">filter</span></dt>
            <dd>
                <p>
                    A function object that is used to transform incoming cancellation
                    signals as they are received from the parent slot. This function
                    object must have the signature:
                </p>
                <pre class="programlisting"><span class="identifier">asio</span><span class="special">::</span><span
                        class="identifier">cancellation_type_t</span> <span class="identifier">filter</span><span
                        class="special">(</span>
    <span class="identifier">asio</span><span class="special">::</span><span
                            class="identifier">cancellation_type_t</span><span class="special">);</span>
</pre>
            </dd>
        </dl>
    </div>
    <p>
        The library provides the following pre-defined cancellation filters:
    </p>
    <div class="itemizedlist">
        <ul class="itemizedlist" type="disc">
            <li class="listitem">
                <a class="link" href="../../disable_cancellation.html" title="disable_cancellation"><code
                        class="computeroutput"><span class="identifier">disable_cancellation</span></code></a>
            </li>
            <li class="listitem">
                <a class="link" href="../../enable_terminal_cancellation.html"
                   title="enable_terminal_cancellation"><code class="computeroutput"><span class="identifier">enable_terminal_cancellation</span></code></a>
            </li>
            <li class="listitem">
                <a class="link" href="../../enable_partial_cancellation.html" title="enable_partial_cancellation"><code
                        class="computeroutput"><span class="identifier">enable_partial_cancellation</span></code></a>
            </li>
            <li class="listitem">
                <a class="link" href="../../enable_total_cancellation.html" title="enable_total_cancellation"><code
                        class="computeroutput"><span class="identifier">enable_total_cancellation</span></code></a>
            </li>
        </ul>
    </div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%">
    <tr>
        <td align="left"></td>
        <td align="right">
            <div class="copyright-footer">Copyright © 2003-2022 Christopher M. Kohlhoff<p>
                Distributed under the Boost Software License, Version 1.0. (See accompanying
                file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
            </p>
            </div>
        </td>
    </tr>
</table>
<hr>
<div class="spirit-nav">
    <a accesskey="p" href="overload2.html"><img src="../../../../prev.png" alt="Prev"></a><a accesskey="u"
                                                                                             href="../cancellation_state.html"><img
        src="../../../../up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img
        src="../../../../home.png" alt="Home"></a><a accesskey="n" href="overload4.html"><img src="../../../../next.png"
                                                                                              alt="Next"></a>
</div>
</body>
</html>
